<?php
$judul = '';
$link = '';
$pencarian = array('0'=>'-- pilih jenis properti --','1' => 'Properti untuk investasi', '2' => 'Properti untuk dibeli (tinggal sendiri)', '3' => 'Properti untuk disewa');

$status = array('1' => 'Belum menikah', '2' => 'Menikah', '3' => 'Menikah punya anak');
$titel = array('1' => 'Bapak', '2' => 'Ibu', '3' => 'Sdr/i');
$pendapatan = array('0'=>'-- pilih pendapatan per tahun --','1'=>'30 juta - 60 juta','2'=>'60 juta - 100 juta','3'=>'>100 juta');
$provinsi = array('0'=>'-- pilih lokasi tinggal --','jakarta' => 'DKI Jakarta', 'jateng' => 'Jawa Tengah', 'jabar' => 'Jawa Barat');


function generate_option($array=array(), $sel='') {
    $x = '';
    foreach ($array as $key => $val) {
        if ($key == $sel) {
            $selected = set_select('option', $sel, TRUE);
        } else {
            $selected = set_select('option', $sel);
        }
        echo '<option value="' . $key . '" ' . $selected . '>' . $val . '</option>';
    }
    return $array[$x];
}

function generate_input($span='', $type='', $array=array(), $name='', $sel='') {
    if ($type == 'radio') {
        foreach ($array as $key => $val) {
            echo '<div class="' . $span . '"><label class="radio"><input data-toggle="radio" checked="" type="' . $type . '" name="' . $name . '" value="' . $key . '">' . $val . '&nbsp;</label></div>';
        }
    } else {
        foreach ($array as $key => $val) {
            echo '<input type="' . $type . '" name="' . $key . '" value="' . $key . '"/>' . $val . '&nbsp;';
        }
    }
}
?>
<script type="text/javascript">
        $(function(){
                $('#dp').datepicker();
            });
    </script>
<div class="page penjuallangsung">
    <div class="container">
        <div class="span12 offset2">
            <form method="post" action="<?php echo site_url('penjual_langsung/tambah'); ?>" id="input-form" class="form-horizontal">
                <legend><h3>Form Penjual Langsung</h3></legend>
                
                    <?php 
                    if($isSubmit == 'true'){
                    if(sizeof($error)>0){ ?>
                    <div class="row">
                    <?php    foreach ($error as $value) {?>    
                            <span class="label label-warning"><?php echo $value; ?></span>   
                    <?php    } ?>
                            <span class="label label-warning">Silakan isi data kembali dengan benar</span> <br/>
                    </div>
                    <?php } else { ?>
                    <div class="row">
                            <span class="label label-success">Data berhasil disimpan</span>
                            </div>
                    <?php } } ?>                
                <div class="control-group">
                    <label class="control-label" for="titel">Titel:</label>
                    <div class="controls">
                        <select name="titel" id="titel" class="span3">
                            <option value="0">Bapak</option>
                            <option value="1">Ibu</option>
                            <option value="2">Sdr/i</option>
                        </select>
                    </div> 
                </div>
                <div class="control-group">
                  <label class="control-label" for="name_depan">Nama Depan</label>
                  <div class="controls">
                    <input type="text" class="input-xlarge" name="name_depan" id="name_depan">
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label" for="name_belakang">Nama Belakang</label>
                  <div class="controls">
                    <input type="text" class="input-xlarge" name="name_belakang" id="name_belakang">
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label" for="email">Alamat E-mail</label>
                  <div class="controls">
                    <input type="text" class="input-xlarge" name="email" id="email">
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label" for="tel">No. HP</label>
                  <div class="controls">
                    <input type="tel" class="input-xlarge" name="tel" id="tel">
                  </div>
                </div>
                <div class="control-group">
                              <label class="control-label" for="birthday">Tanggal Lahir</label>
                              <div class="controls">
                                <div class="input-append date" id="dp" data-date="12-09-2013" data-date-format="dd-mm-yyyy">
                                <input class="span2" size="16" type="text" value="12-09-2013" name="birthday" id="birthday">
                                <span class="add-on"><i class="icon-th"></i></span>
                                </div>
                              </div>
                        </div>
                <div class="control-group">
                    <label class="control-label" for="status">Status Keluarga:</label>
                    <div class="controls">
                        <select name="status" id="status" class="span3">
                            <option value="0">Belum Menikah</option>
                            <option value="1">Menikah</option>
                            <option value="2">Menikah punya anak</option>
                        </select>
                    </div> 
                </div>
                <div class="control-group">
                  <label class="control-label" for="tinggal_di">Kini saya tinggal di</label>
                  <div class="controls">
                    <input type="text" class="input-xlarge" name="tinggal_di" id="tinggal_di">
                  </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="cari_properti">Status Keluarga:</label>
                    <div class="controls">
                        <select name="cari_properti" id="cari_properti" class="span3">
                            <option value="0">Properti untuk investasi</option>
                            <option value="1">Properti untuk dibeli (tinggal sendiri)</option>
                            <option value="2">Properti untuk disewa</option>
                        </select>
                    </div> 
                </div>
                <div class="control-group">
                    <label class="control-label" for="pendapatan">Pendapatan Tahunan</label>
                    <div class="controls">
                        <select name="pendapatan" id="pendapatan" class="span3">
                            <option value="0">30jt - 60jt</option>
                            <option value="1">60jt - 100jt</option>
                            <option value="2">> 100jt</option>
                        </select>
                    </div> 
                </div>
                <label class="checkbox offset" for="checkbox_berlangganan">
                    <input type="checkbox" name="mau_proyek" for="mau_proyek" value="1" id="checkbox_berlangganan" data-toggle="checkbox">
                    Berlangganan untuk menerima proyek baru via email
                </label>
                <label class="checkbox offset" for="checkbox_info_baru">
                    <input type="checkbox" name="mau_info" for="mau_info" value="1" id="checkbox_info_baru" data-toggle="checkbox">
                    Beritahu saya tentang artyproperty.com informasi terbaru dan tawaran agency
                </label>
                <div class="span4 offset2">
                    <input type="submit" name="SUBMIT"  class="btn btn-primary btn-large span3" value="Submit" />
                </div>
            </form>
        </div>
    </div>
</div>